<?php
class Successes extends Public_Controller
{
	function __construct()
	{
		parent::__construct();
	}
	
	function index(){
        $data['successes'] = new Success();
        $data['successes']->where("status = 'approve'")->order_by("id","desc")->get_page(10);
        $this->template->build('index',$data);
    }
    
    function view($id){
        $data['success'] = new Success($id);
		$data['attachs'] = new Attach();
        $data['attachs']->where("module = 'successes' and content_id = ".$id)->order_by('id','asc')->get();
        $this->template->build('view',$data);
    }
}
?>